verifying mean value theorem